home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / Volume.h < prev    next >
Encoding:
Text File  |  1993-01-14  |  2.8 KB  |  91 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1993 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Programmer: Kent Sandvik
  5.   Date: 1/5/93
  6.   Revision comments are at the end of this file.
  7.   ---
  8.   TVolume is a simple volume based utility class (provides information about volumes)     
  9.   TVolume.h contains the TVolume class definitions. 
  10.   _________________________________________________________________________________________________________ */
  11.  
  12. // Declare label for this header file
  13. #ifndef _VOLUME_
  14. #define _VOLUME_
  15.  
  16. #ifndef _DTSCPLUSLIBRARY_
  17. #include "DTSCPlusLibrary.h"
  18. #endif
  19.  
  20. // TOOLBOX HEADER FILES
  21. #ifndef __FILES__
  22. #include <Files.h>
  23. #endif
  24.  
  25. #ifndef __TYPES__
  26. #include <Types.h>
  27. #endif
  28.  
  29. #ifndef __FOLDERS__
  30. #include <Folders.h>
  31. #endif
  32.  
  33. #ifndef __ERRORS__
  34. #include <Errors.h>
  35. #endif
  36.  
  37.  
  38. // _________________________________________________________________________________________________________ //
  39. //    TVolume Class Interface.
  40. class TVolume
  41. // TVolume will provide volume level information about mounted volumes.
  42. {
  43. public:
  44.     // CONSTRUCTORS AND DESTRUCTORS
  45.     TVolume();                                    // default constructor
  46.     TVolume(short refNum);                        // constructor that accepts a volume refnum
  47.     virtual~ TVolume();                            // default destructor
  48.  
  49.     // MAIN INTERFACE
  50.     virtual short GetBootVRefNum();                // find out the VRefNum of the boot volume
  51.     virtual long GetKFreeSpace();                // get amount of free space (Kb) on volume
  52.     virtual long GetFileCount();                // return amount of files on volume    
  53.     virtual long GetDirCount();                    // return amount of folders on volume    
  54.     virtual long GetCreationDate();                // return creation date of volume
  55.     virtual short GetDriverNumber();            // get actual driver number    
  56.     virtual Boolean GetName(Str255& name);        // get driver FSSpec
  57.     virtual short GetNumVolumes();                // get # of mounted volumes
  58.  
  59.     // ITERATORS
  60.     virtual void Reset();                        // get back to boot volume
  61.     virtual Boolean Last();                        // last volume?
  62.     virtual void Next();                        // iterate to next volume
  63.  
  64.     // INTERNAL FUNCTIONS
  65.     virtual Boolean GetHParamBlock();            // generate a lookup in a pre-defined param block
  66.  
  67.     // GET/SET FUNCTIONS
  68.     virtual void SetVRefNum(const short refNum);// set used VRefNum
  69.     virtual short GetVRefNum() const;            // get currently used VRefNum
  70.  
  71.     // FIELDS
  72. protected:
  73.     short fVRefNum;                                // the volume VRefNum
  74.     HParamBlockRec fPB;                            // paramBlock rec used everywhere
  75.     OSErr fError;                                // latest error
  76.     short fIndex;                                // volume index
  77.     Boolean fLast;                                // indicator if we have the last volume
  78. };
  79.  
  80.  
  81. #endif
  82.  
  83. // _________________________________________________________________________________________________________ //
  84.  
  85.  
  86. /*    Change History (most recent last):
  87.   No        Init.    Date        Comment
  88.   1            khs        1/5/93        New file
  89.   2            khs        1/7/93        Cleanup
  90. */
  91.